import http from "@/api/axios";
import { BusinessType } from "@/api/moduleConfig";
export const getListApi = (data: StatementPayable.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/page`,
    data
  });
};
export const getPageStaticApi = (data: StatementPayable.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/pageStat`,
    data
  });
};
// 详情
export const getPayableStatementInfoApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/getStatementDetail/${id}`
  });
};
// 撤销
export const revokePayableStatementApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/revokePayableStatement/${id}`
  });
};
// 导入应付对账单
export const importPayableStatementApi = (data: { statementType: number; companyId: string }, formData: FormData) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/importPayableStatement/${data.statementType}/${data.companyId}`,
    data: formData,
    headers: {
      "Content-type": "multipart/form-data"
    }
  });
};
// 导出
export const exportDataApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `export/biz/exportExcel/financePayableStatement/exportPayableStatement`,
    data
  });
};
// 获取待接收账单
export const getPreAcceptedBillListApi = (data: StatementPayable.PreAcceptedBillParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financeReceiveStatement/page`,
    data
  });
};
// 待接收标签 数量
export const getPreAcceptedPageStaticApi = (data: StatementPayable.PreAcceptedBillParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financeReceiveStatement/pageStat`,
    data
  });
};
// 接收账单
export const receivePayableStatementApi = (data: { statementType: number; ids: string[] }) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financeReceiveStatement/receivePayableStatement`,
    data
  });
};
// 待接收账单 查看详情
export const receivePayableStatementInfoApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financeReceiveStatement/getStatementDetail/${id}`
  });
};
// 待接收账单按钮 - 数据统计
export const preAcceptedPagStateApi = () => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/getWaitReceiveStatementCount`
  });
};
// 下载 模板
export const downloadTemplateApi = (params: { type: number }) => {
  return http({
    method: "get",
    url: `${BusinessType.finance}/biz/deposit/getImportTemplate`,
    params
  });
};
// 生成对账
export const generateAccountStatementApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/generateAccountStatement/${id}`
  });
};
// 详情 查看费用
export const getFeeByWyabillIdApi = (waybillId: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatementShipment/getPayableShipmentFeeDetail/${waybillId}`
  });
};
// 详情-查看费用-添加费用
export const addFeeToPayableApi = (data: StatementPayable.AddFeeToPayable) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableShipmentFee/saveShipmentFee`,
    data
  });
};
// 详情-查看费用-修改费用
export const modifyFeeToPayableApi = (data: StatementPayable.ModifyFeeToPayable) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableShipmentFee/updateShipmentFee`,
    data
  });
};
// 详情-查看费用-删除费用
export const deleteFeeToPayableApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableShipmentFee/delShipmentFee/${id}`
  });
};
// 详情-查看问题
export const getProblemListApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatementShipment/getShipmentProblem/${id}`
  });
};
// 统计
export const statisticsDataApi = (data: StatementPayable.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/getPayableStatementStatistics`,
    data
  });
};

// 统计
export const exportPayableShipmentExcelApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `export/biz/exportExcel/financePayableStatementShipment/exportPayableShipmentExcel`,
    data
  });
};

//应付对账单 - 撤销已生成的账单
export const withdrawBillApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePayableStatement/withdrawBill`,
    data
  });
};
